package com.liang.demo.config.spring;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;

/**
 * @author 陈琪亮
 * @version 1.0
 * @date 2021/3/21 22:43
 */
@ControllerAdvice
public class ExceptionHandle {
    private final static Logger logger = LoggerFactory.getLogger(ExceptionHandle.class);

//    这里会捕获springsecurity的无权限异常，导致handle失效
//    @ExceptionHandler(Exception.class)
//    @ResponseBody
//    public RestResponse handlerException(Exception e) {
//        logger.error(e.getMessage(), e);
//        return new RestResponse<>(SystemCode.InnerError.getCode(), SystemCode.InnerError.getMessage());
//    }


}